package com.dongjiantong.quarantine.enums;

/**
 * Created by mz on 8/12/17.
 *
 */
public enum ProductType {
    HEAD(1,"头部"),
    INTERNAL(2,"内脏"),
    KET(3,"酮体"),
    HEAD_INTERNAL_KET(4,"头部,内脏,酮体"),
    HEAD_INTERNAL(5,"头部,内脏"),
    HEAD_KET(6,"头部,酮体"),
    INTERNAL_KET(7,"内脏,酮体");

    private final Integer value;
    private final String description;

    ProductType(Integer value, String description) {
        this.value = value;
        this.description = description;
    }

    public static ProductType from(Integer value) {
        for (ProductType productType : ProductType.values()) {
            if (productType.value == value) {
                return productType;
            }
        }
        return null;
    }

    public Integer value() {
        return this.value;
    }

    @Override
    public String toString() {
        return description;
    }
}
